<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//Route::middleware('auth:api')->get('/user', function (Request $request) {
//    return $request->user();
//});

$api = app('Dingo\Api\Routing\Router');
$func = function ($api) {
    $api->group(['namespace' => 'App\Api\V2\Controller\Store', 'prefix' => 'v2/Store', 'middleware' => 'user.api'], function ($api) {
        $api->group(['prefix' => 'Store'], function ($api) {
            //小程序统计 每日收款统计
            $api->get("getPStore", "StoreController@getPStore");
        });
        $api->group(['prefix' => 'StorePayWay'], function ($api) {
            //小程序统计 每日收款统计
            $api->get("getPayAmountE", "StorePayWayController@getPayAmountE");

            $api->post("upPayAmountE", "StorePayWayController@upPayAmountE");
            $api->get("getSettlementType", "StorePayWayController@getSettlementType");
            $api->post("upSettlementType", "StorePayWayController@upSettlementType");
        });
        $api->group(["prefix" => "Sign"], function ($api) {
            $api->post("signSet", "SignController@signSet");
        });
    });
};
$api->version("v1", $func);









/*   Route::group(["prefix" => "v2"], function () {

       Route::group(["prefix" => "incoming"], function () {
           Route::group(["prefix" => "Qr", "middleware" => \App\Http\Middleware\AuthenticateApi::class], function () {
               Route::post("createQr", "\App\Api\V2\Controller\Incoming\QrController@createQr");

               Route::get("lists", "\App\Api\V2\Controller\Incoming\QrController@lists");
           });

       });
   });*/

